import request from '../utils/request';
import personalRequest from '../utils/personalRequest'


export const createResume = query => {
    return request.post("/zsrencai/api/person/resume/save", query)
};
//工作区域字典
export const dictName = () => {
    return request.get('/zsrencai/api/sys/admin/dict/get/work_exp,education,company_nature,allure,work_mode')
}

// feat: 工作区域
export const parentArea = () => {
    return request.get('/zsrencai/api/sys/admin/pr/find/parent/360900')
}

export const industry = () => {
    return request.get('/zsrencai/api/sys/admin/tc/find/tree')
}
//职位列表
export const list = (query) => {
    return request.post('/zsrencai/api/ms/job/list/page', query, {
        headers: {
            'Authorization': localStorage.getItem("ps_Authorization") ? "Bearer " + localStorage.getItem("ps_Authorization") : ''
        }
    })
}
//收藏
export const Collection = (query) => {
    return request.post('/zsrencai/api/ms/job/favorite/save', query, {
        headers: {
            'Authorization': "Bearer " + localStorage.getItem("ps_Authorization")
        }
    })
}
//职位类别字典
export const category = () => {
    return request.get('/zsrencai/api/sys/admin/jc/find/tree')
}
// 检测企业token
export const enterpriseToken = query => {
    return request.post('/zsrencai/api/company/company/selectcompanybyuserid', {}, {
        headers: {
            'Authorization': "Bearer " + query
        }
    })
}

// 检测个人token

export const personalToken = query => {
    return personalRequest.get('/zsrencai/api/person/user/webValidatorLogin', {
        headers: {
            'Authorization': "Bearer " + query
        }
    })
}
// //工作经验字典
// export const work_exp = ()=>{
//     return request.get('/zsrencai/api/sys/admin/dict/find/work_exp')
// }



// 找工作 模块 相关接口 time :2020/5/8 qixiaofei

// 收藏-申请管理-一键申请
export const deliverSave = query => {
    return request.post('/zsrencai/api/ms/resume/deliver/save', query, {
        headers: {
            'Authorization': "Bearer " + localStorage.getItem("ps_Authorization")
        }
    })
}

// // 主站 查看简历列表
export const gitInterface = query => {
    return request.get(`/zsrencai/api/person/resume/selectResumeList`, {
        headers: {
            'Authorization': "Bearer " + localStorage.getItem("ps_Authorization")
        }
    })
}
// 是否将该份简历设置为快速投递(推荐)
export const updateExpress = query => {
    return request.post(`/zsrencai/api/person/resume/updateExpress`, query, {
        headers: {
            'Authorization': "Bearer " + localStorage.getItem("ps_Authorization")
        }
    })
}
// 通过id获取职位详情页
export const getpositionById = query => {
    return request.get(`/zsrencai/api/ms/job/get/${query}`)
}

// 通过id获取职位详情页 +userID
export const getpositionByIdUser = (queryObj, token) => {
    return request.get(`/zsrencai/api/ms/job/get/${queryObj.query}/${queryObj.userId}`, token)
}








/** 企业详情页相关接口 time :2020/5/20 wangating  start **/

// 通过id获取企业详情页
export const getById = query => {
    return request.get(`/zsrencai/api/ms/company/getById/${query}`)
}
// 取消收藏
export const cancelCollection = query => {
    return request.post(`/zsrencai/api/ms/job/favorite/delete`, query, {
        headers: {
            'Authorization': "Bearer " + localStorage.getItem("ps_Authorization")
        }
    })
}
// 修改简历是否快速投递
export const isExpress = query => {
    return request.post(`/zsrencai/api/ms/resume/updateExpress`, query, {
        headers: {
            'Authorization': "Bearer " + localStorage.getItem("ps_Authorization")
        }
    })
}
/** end */


// 工商登记已认证
// 工商登记
// 税务登记已认证 2020/06/29
// qixiaofei

// 查询企业详情 工商登记已认证/税务登记已认证
// export const corporationByname = query => {
//     return request.post(`/zsrencai/api/ms/company/query/corporation/info/byname`, query)
// }

// 工商登记未认证
export const businessCertificationByname = query => {
    return request.post(`/zsrencai/api/ms/company/query/businessCertification/info/byname`, query)
}

// 税务登记已认证
export const taxCertificationByname = query => {
    return request.post(`/zsrencai/api/ms/company/query/taxCertification/info/byname`, query)
}

// 通过企业名称查询严重违法失信企业名单
export const yzwfsxqymdByname = query => {
    return request.post(`/zsrencai/api/ms/company/query/yzwfsxqymd/info/byname`, query)
}

// 通过企业名称查询企业异常名录信息
export const qyycmlxxByname = query => {
    return request.post(`/zsrencai/api/ms/company//query/qyycmlxx/info/byname`, query)
}



/**职位投诉管理-发布投诉 time :2020/6/22 wangating  start **/
export const complaintInsert = query => {
    return request.post(`/zsrencai/api/ms/job/complaint/insert`, query, {
        headers: {
            'Authorization': "Bearer " + localStorage.getItem("ps_Authorization")
        }
    })
}

/**end*/



/** 职位详情页打开聊天窗口接口 time :2020/7/29 wangating  start **/
export const chatInsert = query => {
    return request.post('/zsrencai/ws/chat/insert', query, {
        headers: {
            'Authorization': "Bearer " + localStorage.getItem("ps_Authorization")
        }
    })
}
/** end **/
// 获取聊天企业联系人列表
export const getChatList = id => {
    return request.get('/zsrencai/api/ms/company-user/query/info/' + id)
}
